package cn.com.yiqi.wsc.entity.lottery;

import org.apache.commons.lang3.StringUtils;

import java.util.Date;

public class LotteryActivity {
    /**
     * 主键id
     */
    private Integer id;

    /**
     * 类型 1大转盘
     */
    private Byte type;

    /**
     * 活动名称
     */
    private String name;

    private String memo;

    /**
     * 开始时间
     */
    private Date startTime;

    /**
     * 结束时间
     */
    private Date endTime;

    /**
     * 活动状态 1未开始 2开始 3关闭
     */
    private Byte status;

    /**
     * 启用禁用
     */
    private Integer enable;

    /**
     * 删除
     */
    private Integer delete;

    /**
     * 可参加的客户等级id
     */
    private Integer limitRankId;

    /**
     * 免费抽奖次数
     */
    private Integer freeTime;

    /**
     * 是否可用积分购买
     */
    private Integer canUsePoint;

    /**
     * 多少积分换多少次数 5:3
     */
    private String pointBuy;

    /**
     * 参与送积分
     */
    private Integer sendPoint;

    /**
     * 是否仅送给未中奖的 0否 1是
     */
    private Byte sendPointType;

    /**
     * 参与次数限制类型 1一天一次 2一人一次 3一天两次 4不限参与次数 5自定义次数
     */
    private Byte joinTimeType;

    /**
     * 自定义一天的参与次数
     */
    private Integer joinTime;

    /**
     * 是否需要关注公众号 0否 1是
     */
    private Byte mustFocusWx;

    /**
     * 总抽奖次数
     */
    private Integer totalDrawCount;

    /**
     * 抽奖规则 json格式
     */
    private String lotteryRules;

    /**
     * 未中奖说明
     */
    private String unwinDesc;

    /**
     * 参与次数
     */
    private Integer joinTotal;
    /**
     * 参与人数
     */
    private Integer joinManTotal;

    /**
     * 领奖人数
     */
    private Integer winTotal;

    /**
     * 新增时间
     */
    private Date insertTime;

    /**
     * 新增用户id
     */
    private Integer insertUserId;

    /**
     * 修改时间
     */
    private Date updateTime;

    /**
     * 修改用户id
     */
    private Integer updateUserId;

    /**
     * 购买一次所需积分
     */
    private Integer costPointToBuy;

    /**
     * 购买一次获得的抽奖次数
     */
    private Integer buyTimes;


    private String statusName;


    private String banner;

    public Integer getCanUsePoint() {
        return canUsePoint;
    }

    public void setCanUsePoint(Integer canUsePoint) {
        this.canUsePoint = canUsePoint;
    }

    public String getBanner() {
        return banner;
    }

    public void setBanner(String banner) {
        this.banner = banner;
    }

    public String getStatusName() {
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public Integer getDelete() {
        return delete;
    }

    public void setDelete(Integer delete) {
        this.delete = delete;
    }

    public void init() {
        if (StringUtils.isNotEmpty(pointBuy)) {
            try {
                String[] str = pointBuy.split(":");
                costPointToBuy = Integer.parseInt(str[0]);
                buyTimes = Integer.parseInt(str[1]);
            } catch (Exception e) {

            }
        }
    }

    public Integer getCostPointToBuy() {
        return costPointToBuy;
    }

    public Integer getBuyTimes() {
        return buyTimes;
    }

    /**
     * 每天最大次数
     */
    public Integer getTimesDay() {
        if (null != joinTimeType) {
            if (joinTimeType == 1) {
                return 1;
            }
            if (joinTimeType == 2) {
                return -1;
            }
            if (joinTimeType == 3) {
                return 2;
            }
            if (joinTimeType == 4) {
                return Integer.MAX_VALUE;
            }
            if (joinTimeType == 5) {
                return joinTime;
            }
        }
        return Integer.MAX_VALUE;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Byte getType() {
        return type;
    }

    public void setType(Byte type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    public Integer getLimitRankId() {
        return limitRankId;
    }

    public void setLimitRankId(Integer limitRankId) {
        this.limitRankId = limitRankId;
    }

    public Integer getFreeTime() {
        return freeTime;
    }

    public void setFreeTime(Integer freeTime) {
        this.freeTime = freeTime;
    }

    public String getPointBuy() {
        return pointBuy;
    }

    public void setPointBuy(String pointBuy) {
        this.pointBuy = pointBuy;
    }

    public Integer getSendPoint() {
        return sendPoint;
    }

    public void setSendPoint(Integer sendPoint) {
        this.sendPoint = sendPoint;
    }

    public Byte getSendPointType() {
        return sendPointType;
    }

    public void setSendPointType(Byte sendPointType) {
        this.sendPointType = sendPointType;
    }

    public Byte getJoinTimeType() {
        return joinTimeType;
    }

    public void setJoinTimeType(Byte joinTimeType) {
        this.joinTimeType = joinTimeType;
    }

    public Integer getJoinTime() {
        return joinTime;
    }

    public void setJoinTime(Integer joinTime) {
        this.joinTime = joinTime;
    }

    public Byte getMustFocusWx() {
        return mustFocusWx;
    }

    public void setMustFocusWx(Byte mustFocusWx) {
        this.mustFocusWx = mustFocusWx;
    }

    public Integer getTotalDrawCount() {
        return totalDrawCount;
    }

    public void setTotalDrawCount(Integer totalDrawCount) {
        this.totalDrawCount = totalDrawCount;
    }

    public String getLotteryRules() {
        return lotteryRules;
    }

    public void setLotteryRules(String lotteryRules) {
        this.lotteryRules = lotteryRules;
    }

    public String getUnwinDesc() {
        return unwinDesc;
    }

    public void setUnwinDesc(String unwinDesc) {
        this.unwinDesc = unwinDesc;
    }

    public Integer getJoinTotal() {
        return joinTotal;
    }

    public void setJoinTotal(Integer joinTotal) {
        this.joinTotal = joinTotal;
    }

    public Integer getJoinManTotal() {
        return joinManTotal;
    }

    public void setJoinManTotal(Integer joinManTotal) {
        this.joinManTotal = joinManTotal;
    }

    public Integer getWinTotal() {
        return winTotal;
    }

    public void setWinTotal(Integer winTotal) {
        this.winTotal = winTotal;
    }

    public Date getInsertTime() {
        return insertTime;
    }

    public void setInsertTime(Date insertTime) {
        this.insertTime = insertTime;
    }

    public Integer getInsertUserId() {
        return insertUserId;
    }

    public void setInsertUserId(Integer insertUserId) {
        this.insertUserId = insertUserId;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getUpdateUserId() {
        return updateUserId;
    }

    public void setUpdateUserId(Integer updateUserId) {
        this.updateUserId = updateUserId;
    }

    public Integer getEnable() {
        return enable;
    }

    public void setEnable(Integer enable) {
        this.enable = enable;
    }

}